fix: Fix gpt-5.6-sol 'ultra' reasoning effort: API rejects effort='ultra' (400) — map to a valid value#400
Open
andrei-hasna wants to merge 1 commit into
Open
Conversation
…tra' (400) — map to a valid value
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective
Fix gpt-5.6-sol 'ultra' reasoning effort: API rejects effort='ultra' (400) — map to a valid value
Bug: selecting the gpt-5.6-sol 'ultra' reasoning tier sends reasoning.effort='ultra' and the model endpoint returns HTTP 400: '[reasoning.effort][invalid_enum_value] Invalid value: ultra. Supported values: none, minimal, low, medium, high, xhigh, max'. codewith exposes an 'ultra' tier but 'ultra' is not a valid API effort. FIX so gpt-5.6-sol-ultra works: translate the codewith 'ultra' effort to a valid wire value (max or xhigh) when building the request, keeping 'ultra' as the user-facing label if desired; or define the sol-ultra preset to use a valid effort. Investigate (cite file:line): ReasoningEffort enum has a Custom(String) variant; effort is serialized to the wire at codex-rs/core/src/session/turn_context.rs:159 via effort.to_string(); model/effort presets live in codex-rs/known-provider-models/ (e.g. lib.rs / zai.rs use ReasoningEffort::Custom("max")); precedent for mapping max->xhigh at codex-rs/external-agent-migration/src/lib.rs:1211. Add a regression test asserting the outgoing request never carries an unsupported effort enum for sol-ultra. The agent MUST start a goal plan and drive it node by node (required). Build and test on remote Blacksmith ONLY (never compile locally); keep cargo fmt (--config imports_granularity=Item), clippy --tests --all-targets -D warnings, and prettier clean; land a PR into hasna/codewith main.
Verification
Run
run_e131b236201f· backendcodewith· taskb33d303f-913a-43c3-812f-0a10dfa3f6e0🏭 Generated by @hasnaxyz/factory